package com.ruoyi.resShop.service.impl;

import com.ruoyi.resShop.domain.NewResShop;
import com.ruoyi.resShop.mapper.ResShopMapper;
import com.ruoyi.resShop.service.ResShopService;
import com.ruoyi.resturant.domain.ResShop;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class NewResShopServiceImpl implements ResShopService {

    @Autowired
    ResShopMapper mapper;

    //初始化一个记录日志对象
    private static final Logger log = LoggerFactory.getLogger(NewResShopServiceImpl.class);
    @Override //董虹妤
    public List<NewResShop> selectShopByIf(NewResShop re) {
        return mapper.selectShopByIf(re);
    }

    @Override
    public List<NewResShop> selectShopByWhen(NewResShop re) {
        return mapper.selectShopByWhen(re);
    }

    @Override
    public NewResShop getShopById(Long id) {
        return mapper.getShopById(id);
    }

    @Override //董虹妤2619
    public int insertNewResShop(NewResShop newResShop){
        return mapper.insertNewResShop(newResShop);
    }
    @Override //董虹妤2619
    public int updateNewResShop(NewResShop newResShop){
        return mapper.updateNewResShop(newResShop);
    }
    @Override //董虹妤2619
    public int deleteNewResShop(int id){
        return mapper.deleteNewResShop(id);
    }

    @Override //董虹妤
    public List<NewResShop> getShopList() {
        List<NewResShop> result = mapper.getShopList();
        if (result.size() <= 0) {
            log.error("查询店铺列表为空");
        }else {
            log.info("2619董虹妤查询除了店铺列表，其有" + result.size() + "个店铺");
        }
        return mapper.getShopList();
    }
}
